import { CHANGE_FOUCS_STATUS, KEYWORD_LIST } from "./constant";
import axios from "axios";
import { fromJS } from "immutable";

export const changeFocusStatus = (value) => {
  return {
    type: CHANGE_FOUCS_STATUS,
    value,
  };
};
const setKeywordList = (list) => ({
  type: KEYWORD_LIST,
  list:fromJS(list)
});

export const getKeywordList = ()=>{
  return async (dispatch)=>{
    const {data} = await axios.get("http://127.0.0.1:5500/data/headerList.json");
    const action = setKeywordList(data.list)
    dispatch(action);
  }
}

